package com.ruoyi.group.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.group.domain.SysDeptaaa;
import com.ruoyi.group.domain.dto.RpRepairOrderMaxDto;
import com.ruoyi.group.service.OrderAssignService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author:黄志超
 * @Todo:工单分派
 * @DateTime:2022/3/18 14:07
 * @Component:蜗牛
 **/
@RestController
@RequestMapping("/allorder")
public class OrderAssignController extends BaseController {
    @Resource
    OrderAssignService OrderAssignService;


    @PostMapping("/all")
  public  TableDataInfo tableDataInfo(){
       String OrderNo = null;
        int status = 0;
        List<RpRepairOrderMaxDto> list =  OrderAssignService.find(OrderNo,status);
        return getDataTable(list);
    }
    @PostMapping("/dept")
    public AjaxResult ajaxResult(){
        List<SysDeptaaa> list = OrderAssignService.findDept();
        return AjaxResult.success(list);
    }

    @GetMapping("/deptPus/{dept}")
    public AjaxResult ajaxResult(@PathVariable Integer dept){
        List<SysDeptaaa> list = OrderAssignService.findDeptss( dept);
        return AjaxResult.success(list);
    }
}
